package com.jumpy.managers;

import org.andengine.opengl.texture.TextureOptions;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.andengine.opengl.texture.region.TiledTextureRegion;
import org.andengine.ui.activity.BaseGameActivity;

public class ResourceManager {

	public static BaseGameActivity mActivity;

	public static TiledTextureRegion mFaceTextureRegion;
	public static TiledTextureRegion mFaceTextureRegion2;

	private static BitmapTextureAtlas mBitmapTextureAtlas;
	private static BitmapTextureAtlas mBitmapTextureAtlas2;

	public static boolean loadResources(BaseGameActivity mActivity) {
		ResourceManager.mActivity = mActivity;

		BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");

		mBitmapTextureAtlas = new BitmapTextureAtlas(
				mActivity.getTextureManager(), 128, 128,
				TextureOptions.BILINEAR);
		mBitmapTextureAtlas2 = new BitmapTextureAtlas(
				mActivity.getTextureManager(), 64, 32, TextureOptions.BILINEAR);
		mFaceTextureRegion = BitmapTextureAtlasTextureRegionFactory
				.createTiledFromAsset(mBitmapTextureAtlas, mActivity,
						"techo.png", 0, 0, 1, 1);
		mFaceTextureRegion2 = BitmapTextureAtlasTextureRegionFactory
				.createTiledFromAsset(mBitmapTextureAtlas2, mActivity,
						"character.png", 0, 0, 2, 1);
		mBitmapTextureAtlas.load();
		mBitmapTextureAtlas2.load();

		return true;
	}

	public static boolean uploadResources() {
		return true;
	}

}
